package com.cmcm.network;

import java.io.File;

/**
 * Created by gezihua on 17-1-4.
 */

public class SafetyFilter {
    public static boolean isSafety(File file) {
        boolean systemLib = isSystemLib(file);
        boolean inWhiteList = isInWhiteList(file);
        return systemLib && inWhiteList;

    }

    public static boolean isInWhiteList(File file) {
        return true;
    }

    public static boolean isSystemLib(File file) {
        boolean containSystemLibrary = (file.toString().contains("layoutlib") ||
                file.toString().contains("com.android.support") ||
                file.toString().contains("org.aspectj") ||
                file.toString().contains("play-services") ||
                file.toString().contains("okhttp") ||
                file.toString().contains("support-annotations")
        );
        return containSystemLibrary;
    }

}
